import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-device-setting',
  templateUrl: './device-setting.component.html',
  styleUrls: ['./device-setting.component.css']
})
export class DeviceSettingComponent implements OnInit {
    networkTableStatus: boolean;
    securityTableStatus: boolean;

    dataCommunicationInformation = {
        url: '',
        userName: '',
        passWord: '',
        networkId: '',
        nodeId: '',
        reportInterval: '',
        resetMultiplier: '',
    };
    communicationMode = [
        {mode: 'Local'},
        {mode: 'Cloud'}
    ];
    selectedCommunicationMode;
    intervalUnit = [
        {unit: 'Second(s)'},
        {unit: 'Minute(s)'}
    ];
    selectIntervalUnit;

    authenticationInformation = {
        userName: '',
        passWord: '',
    };

    WLANAPInformation = {
        SSID: '',
    };
    countyCode = [
        {code: 'Channels 1~11 US, Canada, Mexico, etc.'},
        {code: 'Channels 1~13 Europe, China, Korea, India, etc.'},
        {code: ' Channels 1~14 Japan'},
    ];
    selectedCountyCode;

    WLANClientInformation = {
        nodeName: '',
        SSID: '',
        password: '',
        ipAddress: '',
        netmask: '',
        gateway: '',
        primaryDNS: '',
        secondaryDNS: '',
    };
    WLANSecurity = [
        {type: 'Open'},
        {type: 'WEP'},
        {type: 'WPA/WPA2 PSK'},
        {type: 'WPA2 PSK'},
    ];
    selectedWLANSecurity;
    addressType = [
        {type: 'DHCP'},
        {type: 'Static'},
    ];
    selectedAddressType;

    firmwareUpgradeInformation = {
        BSNFirmwareVersion: '',
        BCGFirmwareVersion: ''
    };
    selectedFirmwareUpgrade = false;

  constructor() { }

  ngOnInit(): void {
  }

    networkTableSwitch(): void{
        console.log(this.selectedAddressType);
        this.networkTableStatus = this.selectedAddressType.type !== 'DHCP';
    }

    securityTableSwitch(): void{
        console.log(this.selectedWLANSecurity);
        this.securityTableStatus = this.selectedWLANSecurity.type !== 'Open';
    }

}
